home *** CD-ROM | disk | FTP | other *** search
Wrap
<?xml version="1.0" encoding="utf-8"?> <html><head><title>Sgn Function [Runtime]</title><meta name="filename" content="text/sbasic/common/03080701"/><meta name="language" content="en-US"/><help:css-file-link xmlns:help="http://openoffice.org/2000/help"/><!--The CSS style header method for setting styles--><style type="text/css"> table.Tabelle1{ } span.Tabelle1A{ width:8.999cm;} td.Tabelle1A3{ } p.P1{ } p.P2{ } span.T1{ font-weight:bold;} </style></head><body> <help:to-be-embedded Eid="sgn" xmlns:help="http://openoffice.org/2000/help"> <p class="Head1"><help:link Id="66485">Sgn Function [Runtime]</help:link></p> <p class="Paragraph">Returns an integer number between -1 and 1 indicating whether the number passed to the function is positive, negative, or zero.</p> </help:to-be-embedded> <p class="Paragraph"><span class="T1">Syntax</span>:</p> <p class="Paragraph">Sgn (Number) <help:key-word value="Sgn" tag="kw66485_1" xmlns:help="http://openoffice.org/2000/help"/></p> <p class="Paragraph"><span class="T1">Return value</span>:</p> <p class="Paragraph">Integer</p> <p class="Paragraph"><span class="T1">Parameter</span>:</p> <p class="Paragraph">Number: Numeric expression which determines the the value returned by the function.</p> <table><tr class=""><th style="text-align:left;"><span class="Tabelle1A"> <p class="TextInTable">NumExpression</p> </span></th><th style="text-align:left;"><span class="Tabelle1A"> <p class="TextInTable">Return value</p> </span></th></tr><tr class=""><td style="text-align:left;"><span class="Tabelle1A"> <p class="TextInTable">negative</p> </span></td><td style="text-align:left;"><span class="Tabelle1A"> <p class="TextInTable">Sgn returns -1.</p> </span></td></tr><tr class=""><td class="Tabelle1A3" style="text-align:left;"><span class="Tabelle1A"> <p class="TextInTable">0</p> </span></td><td style="text-align:left;"><span class="Tabelle1A"> <p class="TextInTable">Sgn returns 0.</p> </span></td></tr><tr class=""><td style="text-align:left;"><span class="Tabelle1A"> <p class="TextInTable">positive</p> </span></td><td style="text-align:left;"><span class="Tabelle1A"> <p class="TextInTable">Sgn returns 1.</p> </span></td></tr></table> <p class="Paragraph"/> <p class="P2">Example:</p> <p class="PropText">Sub ExampleSgn</p> <p class="PropText">Print sgn(-10) REM returns -1</p> <p class="PropText">Print sgn(0) <text:s text:c="2" xmlns:text="http://openoffice.org/2000/text"/>REM returns 0</p> <p class="PropText">Print sgn(10) <text:s text:c="" xmlns:text="http://openoffice.org/2000/text"/>REM returns 1</p> <p class="PropText">end sub</p> <p class="PropText"/> </body></html>